/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "PUB_APPS")
public class PubApps extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "系统接口";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_APPNAME = "系统名称";
	public static final String ALIAS_APPURL = "系统url";
	public static final String ALIAS_APPSORT = "系统排序";
	public static final String ALIAS_CATEGORY = "类别（1子系统 0应用接口）";
	public static final String ALIAS_MEMO = "备注";
	public static final String ALIAS_ISSYS = "是否内部系统";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	private java.lang.Long id;
    /**
     * 系统名称       db_column: APPNAME 
     */ 	
	@Length(max=150)
	private java.lang.String appname;
    /**
     * 系统url       db_column: APPURL 
     */ 	
	@Length(max=300)
	private java.lang.String appurl;
    /**
     * 系统排序       db_column: APPSORT 
     */ 	
	@Max(32767)
	private Integer appsort;
    /**
     * 类别       db_column: CATEGORY 
     */ 	
	@Max(127)
	private Integer category;
    /**
     * 备注       db_column: MEMO 
     */ 	
	@Length(max=400)
	private java.lang.String memo;
	/**
     * 是否内部系统       db_column: ISSYS 
     */ 	
	@Max(127)
	private Integer issys;
	private Integer isshfw;
	//columns END
	
	@Column(name = "ISSHFW", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getIsshfw() {
		return isshfw;
	}

	public void setIsshfw(Integer isshfw) {
		this.isshfw = isshfw;
	}


	public PubApps(){
	}

	public PubApps(
		java.lang.Long id
	){
		this.id = id;
	}

	

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public java.lang.Long getId() {
		return this.id;
	}
	
	@Column(name = "APPNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getAppname() {
		return this.appname;
	}
	
	public void setAppname(java.lang.String value) {
		this.appname = value;
	}
	
	@Column(name = "APPURL", unique = false, nullable = true, insertable = true, updatable = true, length = 300)
	public java.lang.String getAppurl() {
		return this.appurl;
	}
	
	public void setAppurl(java.lang.String value) {
		this.appurl = value;
	}
	
	@Column(name = "APPSORT", unique = false, nullable = true, insertable = true, updatable = true, length = 3)
	public Integer getAppsort() {
		return this.appsort;
	}
	
	public void setAppsort(Integer value) {
		this.appsort = value;
	}
	
	@Column(name = "CATEGORY", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getCategory() {
		return this.category;
	}
	
	public void setCategory(Integer value) {
		this.category = value;
	}
	
	@Column(name = "MEMO", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getMemo() {
		return this.memo;
	}
	
	public void setMemo(java.lang.String value) {
		this.memo = value;
	}
	
	@Column(name = "ISSYS", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getIssys() {
		return this.issys;
	}
	
	public void setIssys(Integer value) {
		this.issys = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Appname",getAppname())
			.append("Appurl",getAppurl())
			.append("Appsort",getAppsort())
			.append("Category",getCategory())
			.append("Memo",getMemo())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PubApps == false) return false;
		if(this == obj) return true;
		PubApps other = (PubApps)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

